{% extends 'base.html' %}
{% load custom %}

{% block page-container %}
    <!-- 左侧栏  -->
    <div class="wrap-left">
        <div class="article-title-bg">
            {{ article_obj.title }}
        </div>
        <div class="article-title-brief">
            <span>作者:{{ article_obj.author.name }}</span>
            <span>{{  article_obj.pub_date|date:"Y-m-d H:i:s" }}</span>
            <span>
                <span class="glyphicon glyphicon-comment" aria-hidden="true"></span>
                {% filter_comment article_obj as comments %}
                <span>评论 </span>{{ comments.comment_count }}
            </span>
        </div>
        <div class="article-content">
            <img class="article-detail-head-img"  src="/static/{{ article_obj.head_img }}">
            {{ article_obj.content | show_html }}
        </div>

        <!-- 点赞 -->
        <div class="Qr-code">
            <div class="praise-box" onclick="article_thumbup(this,{{ article_obj.id }},'2','','')">
                <a tabindex="0" id="thumbup" class="btn btn-success" role="button" data-toggle="popover" data-trigger="focus" data-content="需要登录才能点赞">
                <i class="icon icon-article-zan" ></i><span class="num">{{ comments.thumb_count }}</span></a>
                <label hidden id="loginstatus">
                    {% if request.user.is_authenticated %}
                        1
                    {% else %}
                        0
                    {% endif %}
                </label>
                <label hidden id="csrfmiddletocken">{% csrf_token %}</label>
            </div>
        </div>
        <hr>

        <!-- 评论区  -->
        <div class="common">
            <div class="pl-form-wrap">
                <span class="span-mark-author active">发表评论</span>
                    <div class="pl-form-box pl-article-wrap">
                        {% if request.user.is_authenticated %}
                            <p><textarea style="resize: none; overflow-y: hidden; height: 80px;" class="form-control" id="saytext" name="saytext" placeholder="客官，8个字起评，不讲价哟"></textarea></p>
                            <p><button class="btn btn-article " onclick="article_thumbup(this,{{ article_obj.id }},'1','','saytext')">发表</button></p>

                        {% else %}
                           <div class="no-login-box ">
                                <a class="moder-lgn-box" href="{% url 'login' %}">登录</a>后参与评论
                            </div>
                        {% endif %}

                    </div>

            </div>
        </div>

        <!--  评论列表 -->
        <div class="row table-bordered ccontent" >

            <ul class="treeview ke-tabs-ul">
                {% common_tree common_list %}

            </ul>
        </div>
        <p></p>
    </div>
    fsdfsdfsdf
    <!--  右侧栏 -->
    <div class="wrap-right">
      right contain
    </div>
    <div class="clear-both"></div>

{% endblock %}


{% block self-js %}
<script type="text/javascript" src="/static/bootstrap/js/artdetail.js"></script>
{% endblock %}